package yxy.cherry.battle.module.affix.skill;

import yxy.cherry.battle.Battle;
import yxy.cherry.battle.Fighter;
import yxy.cherry.battle.module.affix.AffixFactory.SkillTypeEnum;
import yxy.cherry.battle.module.affix.Skill;
import yxy.cherry.battle.module.affix.SkillType;
import yxy.cherry.data.bean.skill;

import java.util.Collection;

/** 无视防御 */
@SkillType(Type = SkillTypeEnum.无视防御)
public class Affix_22_无视防御 extends Skill {

	public Affix_22_无视防御(Fighter actor, skill skilldata, int probability, int[] params) {
		super(actor, skilldata, probability, params);
	}

	public boolean _exec(Collection<Fighter> targets) {
		if (!isEffectiveOne(getActor())) {
			return false;
		}
		for(Fighter fighter:targets){
			fighter.getAffixContext().set无视防御(true);
			Battle.battleLogger(6,"无视防御："+fighter.getName());
		}
		return true;
	}

	@Override
	public boolean exec(Fighter actor, Fighter target) {
		return true;
	}
}